<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <title></title>
    <meta name="renderer" content="webkit" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="viewport"
        content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0" />
    <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all" />
    <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all" />
    <style>
        .layui-form-item .layui-input-inline {
            width: 150px;
        }

        .layui-form-label {
            padding: 9px 5px;
            width: auto;
        }

        .layui-table-cell {
            height: auto;
            overflow: visible;
            text-overflow: inherit;
            white-space: normal;
        }
    </style>
</head>

<body>
    <div class="layui-fluid">
        <div class="layui-card">
            <form class="layui-form" action="" id="sbumitForm">
                <div class="layui-form layui-card-header layuiadmin-card-header-auto">
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label">创建时间</label>
                            <div class="layui-input-inline">
                                <input type="text" name="creat_time" placeholder="开始日期" id="creat_time" readonly
                                    autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-inline ">
                            <label class="layui-form-label">赛事类型</label>
                            <div class="layui-input-inline" style="width: 100px">
                                <select name="sport_id">
                                    <option value="">全部</option>
                                    <option value="1">足球</option>
                                    <option value="2">篮球</option>
                                </select>
                            </div>
                        </div>

                        <div class="layui-inline">
                            <label class="layui-form-label">所属赛事ID</label>
                            <div class="layui-input-inline">
                                <input type="text" name="match_id" placeholder="所属赛事ID" autocomplete="off"
                                    class="layui-input">
                            </div>
                        </div>

                        <div class="layui-inline">
                            <label class="layui-form-label">推送标题</label>
                            <div class="layui-input-inline">
                                <input type="text" name="title" placeholder="推送标题" autocomplete="off"
                                    class="layui-input">
                            </div>
                        </div>

                        <div class="layui-inline">
                            <label class="layui-form-label">操作人</label>
                            <div class="layui-input-inline">
                                <input type="text" name="operator" placeholder="操作人" autocomplete="off"
                                    class="layui-input">
                            </div>
                        </div>

                        <div class="layui-inline ">
                            <label class="layui-form-label">推送状态</label>
                            <div class="layui-input-inline" style="width: 100px">
                                <select name="push_status">
                                    <option value="">全部</option>
                                    <option value="1">待推送</option>
                                    <option value="2">已推送</option>
                                </select>
                            </div>
                        </div>

                        <div class="layui-inline">
                            <label class="layui-form-label">所属赛事名称</label>
                            <div class="layui-input-inline">
                                <input type="text" name="comp" placeholder="所属赛事名称" autocomplete="off"
                                    class="layui-input">
                            </div>
                        </div>

                        <div class="layui-inline">
                            <div class="layui-btn" id="FormSubmit">
                                <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-inline ">
                            <div class="layui-input-inline">
                                <div class="layui-btn" onclick="add()">
                                    <i class="layui-icon layui-icon-add-1 layuiadmin-button-btn"></i>新建
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </form>
            <div class="layui-card-body">

                <table id="LAY-push-manage" lay-filter="LAY-push-manage"></table>
                <script type="text/html" id="table-push-operation">
                <a class="layui-btn layui-btn layui-btn-xs" lay-event="edit"><i class="layui-icon layui-icon-edit"></i>编辑</a>
                <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i class="layui-icon layui-icon-edit"></i>删除</a>
                <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="push"><i class="layui-icon layui-icon-edit"></i>立即推送</a>
                </script>
            </div>
        </div>
    </div>

    <script src="/layuiadmin/layui/layui.js"></script>
    <script>
        function add() {
            layer.open({
                type: 2,
                title: ["添加", 'font-size:16px'],
                content: '/admin/offline_push/add',
                area: ['750px', '665px'],
                //offset: '0px',
            });
        }

        layui.config({
            base: '/layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index' //主入口模块
        }).use(['index', 'offline_push', 'table'], function () {
            var $ = layui.$
                , form = layui.form
                , table = layui.table;

            //监听搜索
            form.on('submit(LAY-push-front-search)', function (data) {
                var field = data.field;

                //执行重载
                table.reload('LAY-push-manage', {
                    where: field
                    , page: {
                        curr: 1   //默认从第一页开始搜索
                    }

                });
            });

            //事件
            var active = {
                add: function () {
                    var index = layer.open({
                        type: 2
                        , title: '新建消息'
                        , content: '/admin/push/add'
                        , maxmin: true
                        , area: ['650px', '500px']
                    });
                    layer.full(index);
                }
            };

            $('.layui-btn.layuiadmin-btn-push').on('click', function () {
                var type = $(this).data('type');
                active[type] ? active[type].call(this) : '';
            });
        });
    </script>
</body>

</html>